import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    // name: 'tab-bar',
    component: () => import('@/views/tab-bar'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home')
      },
      {
        path: 'qa',
        name: 'qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/mytext',
        name: 'mytext',
        component: () => import('@/views/my/components/mytext')
      },
      {
        path: 'like',
        name: 'like',
        component: () => import('@/views/like')
      },
      {
        path: 'my',
        name: 'my',
        component: () => import('@/views/my')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search')
  },
  {
    path: '/text/:id',
    name: 'text',
    component: () => import('@/views/text')
  },
  {
    path: '/comment',
    name: 'comment',
    component: () => import('@/components/article-comment')
  },
  {
    path: '/sharetext',
    name: 'sharetext',
    component: () => import('@/components/sharetext')
  },
  {
    path: '/autor/:name',
    name: 'autor',
    component: () => import('@/components/autor')
  },
  {
    path: '/edituser',
    name: 'edituser',
    component: () => import('@/views/edituser')
  },
  {
    path: '/fans/:user/:active',
    name: 'fans',
    component: () => import('@/views/fans')
  },
  {
    path: '/chathistory/:name',
    name: 'chathistory',
    component: () => import('@/components/chathistory')
  },
  {
    path: '/historytext',
    name: 'historytext',
    component: () => import('@/views/my/components/history-text')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/components/disableshow')
  }
]

const router = new VueRouter({
  routes
})

export default router
